C.MapObjects = { };

C.MapObjects.Planets = { };
C.MapObjects.Colors = { };
C.MapObjects.Blooms = { };

function C.ClearPlanets( um )
	
	C.MapObjects.Planets = { };
	C.MapObjects.Colors = { };
	C.MapObjects.Blooms = { };
	
end
usermessage.Hook( "SM_S", C.ClearPlanets );

function C.SyncPlanet( um )
	
	table.insert( C.MapObjects.Planets, {
		pos = um:ReadVector(),
		radius = um:ReadShort(),
		gravity = um:ReadFloat(),
		pressure = um:ReadFloat(),
		suntemp = um:ReadShort(),
		shadetemp = um:ReadShort(),
		colorid = um:ReadString(),
		bloomid = um:ReadString(),
		flag = um:ReadShort(),
	} );
	
end
usermessage.Hook( "SM_1", C.SyncPlanet );

function C.SyncColor( um )
	
	table.insert( C.MapObjects.Colors, {
		addcol = um:ReadVector(),
		mulcol = um:ReadVector(),
		brightness = um:ReadFloat(),
		contrast = um:ReadFloat(),
		color = um:ReadFloat(),
		id = um:ReadString(),
	} );
	
end
usermessage.Hook( "SM_2", C.SyncColor );

function C.SyncBloom( um )
	
	table.insert( C.MapObjects.Blooms, {
		color = um:ReadVector(),
		x = um:ReadFloat(),
		y = um:ReadFloat(),
		passes = um:ReadFloat(),
		darken = um:ReadFloat(),
		multiply = um:ReadFloat(),
		colormul = um:ReadFloat(),
		id = um:ReadString(),
	} );
	
end
usermessage.Hook( "SM_3", C.SyncBloom );
